<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    echo heading("Alterar Contas",4,"class='divisor'");
    $idConta = $this->uri->segment(3);
    if($idConta == NULL) redirect('PrincipalController');
    $query = $this->ContaModel->getIdConta($idConta)->row();				
    $atributos_formulario = array('class' => 'form-signin', 'id'=>'formcadastro');
    echo form_open ("ContaController/chamarTelaAlterarConta/$idConta", $atributos_formulario);
        if(validation_errors())
        { echo '<div class="alert alert-danger">
                 <button type="button" class="close " data-dismiss="alert">&times;</button>
                 <span>'.validation_errors().'</span>
            </div>';
        }
        if($this->session->flashdata('alterarok')):
            echo "<div class=alert>";
            echo "<p class='validacoes'>".$this->session->flashdata('alterarok')."</p>";
            echo "</div>";
        endif;
        echo form_label('Descrição da Conta ::','conta');
        echo form_input(array('name'=>'descricao'), set_value('descricao', $query->descricao),'autofocus');
        echo br();
        $btnGravar = array('name' => 'button','id' => 'button','value' => 'true','type' => 'submit','content' => 'Gravar', 'class' => 'btn btn-primary');
        echo form_button($btnGravar);
        echo nbs(4);                                
        $btnLimpar = array('name' => 'button', 'id' => 'button', 'value' => 'true', 'type' => 'reset', 'content' => 'Limpar', 'class' => 'btn btn-primary');
        echo form_button($btnLimpar);
        echo nbs(4);
        echo anchor("PrincipalController/",' Voltar ', array('title' =>'Voltar para principal', 'class' => 'btn btn-danger'));
        echo form_hidden('idConta', $query->id_conta);
    echo form_close();
?>